import openpyxl
import json

# 打开 Excel 文件
workbook = openpyxl.load_workbook('/Users/xuyihang/Desktop/QC01未完结.xlsx')
# 获取第一个工作表
worksheet = workbook.active

# 遍历每一行和每一列，将数据转换成对应的 Python 对象
data = []
for row in worksheet.iter_rows(min_row=2, values_only=True):
    row_data = {}
    row_data['flowNumber'] = row[0]
    row_data['qcNumber'] = row[1]
    row_data['flowName'] = row[2]
    row_data['flowNetName'] = row[3]
    row_data['flowCurrentPerson'] = row[4]
    row_data['flowNetPerson'] = row[6]
    row_data['flowDate'] = row[7]
    row_data['flowMsg'] = row[8]
    data.append(row_data)

# 将 Python 对象转换成 JSON
json_data = json.dumps(data,ensure_ascii=False)
print(json_data)